import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Random;

/***
 * @program: maven
 * @ClassName: String1
 * @Description:
 * @Author: chenxiejia
 * @Date: 2022/1/12 16:24
 * @version : V1.0
 */
public class task {
    public static void main(String[] args) {
        String file = "c:/user/abc/upload/xxsfasf.afasf-asfas.jpg";
//        System.out.println(file.substring(file.lastIndexOf("/") + 1));
//        System.out.println(file.substring(file.lastIndexOf(".")));
//        System.out.println(file.substring(file.lastIndexOf("/") + 1, file.lastIndexOf(".")));
        String s1 = file.substring(file.lastIndexOf("/") + 1);
        String s2 = file.substring(file.lastIndexOf("."));
        System.out.println(s1);
        System.out.println(s2);
        String s3 = file.substring(file.lastIndexOf("/") + 1, file.lastIndexOf("."));
        var cs = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssS");
        var t = sdf.format(cs.getTime());
        System.out.println(t);
        Random rand = new Random();

    }
}
